home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Host C Library Procedures Host
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- Host_ByName, Host_ByID, Host_ByNetAddr, Host_ByInetAddr,
- Host_SetFile, Host_Start, Host_Next, Host_End - return
- information about Sprite machines
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<hhoosstt..hh>>
-
- Host_Entry *
- HHoosstt__BByyNNaammee(_n_a_m_e)
-
- Host_Entry *
- HHoosstt__BByyIIDD(_s_p_r_i_t_e_I_D)
-
- Host_Entry *
- HHoosstt__BByyNNeettAAddddrr(_a_d_d_r_P_t_r)
-
- Host_Entry *
- HHoosstt__BByyIInneettAAddddrr(_i_n_e_t_A_d_d_r)
-
- int
- HHoosstt__SSeettFFiillee(_f_i_l_e_N_a_m_e)
-
- int
- HHoosstt__SSttaarrtt()
-
- Host_Entry *
- HHoosstt__NNeexxtt()
-
- void
- HHoosstt__EEnndd()
-
- int
- HHoosstt__SSttaatt(_s_t_a_t_P_t_r)
-
- AARRGGUUMMEENNTTSS
- char *_n_a_m_e (in) The name of a Sprite
- host for which infor-
- mation is desired.
-
- int _s_p_r_i_t_e_I_D (in) The Sprite ID of the
- host for which infor-
- mation is desired.
-
- Net_Address *_a_d_d_r_P_t_r (in) The local network
- address of the host
- for which information
- is desired.
-
- Net_InetAddress _i_n_e_t_A_d_d_r (in) The internet address
-
-
-
- Sprite v.1.0 Printed: June 9, 1992 1
-
-
-
-
-
-
- Host C Library Procedures Host
-
-
-
- of the host for which
- information is
- desired.
-
- char *_f_i_l_e_N_a_m_e (in) The name of a host-
- description file.
-
- struct _s_t_a_t (*statPtr)
- Pointer to stat
- structure for host
- database file.
-
- _________________________________________________________________
-
- DDEESSCCRRIIPPTTIIOONN
- These functions are used to learn about hosts on the local
- Sprite network. These functions cause the host description
- file to be opened. HHoosstt__EEnndd(()) must be called to close the
- file.
-
- A Host_Entry structure is defined as follows:
-
- typedef struct {
- char *name; /* Primary name */
- char **aliases; /* Other names */
- int id; /* Sprite ID */
- char *machType; /* Machine type, i.e "sun3" */
- int numNets; /* Number of network interfaces the
- * host has. */
- Host_Interface nets[HOST_MAX_INTERFACES];
- /* Internet and physical address for
- * each network interface. */
- } Host_Entry;
-
- typedef struct Host_Interface {
- Net_InetAddress inetAddr; /* Internet address */
- Net_Address netAddr; /* Physical address */
- } Host_Interface;
-
- The _n_u_m_N_e_t_s field indicates how many network interfaces the
- host has. One entry in the _n_e_t_s array will be filled in per
- interface. Unused entries will have the network type in
- _n_e_t_A_d_d_r _s_e_t _t_o NNEETT__AADDDDRREESSSS__NNOONNEE.
-
- The Host_Entry structures returned by the routines are stat-
- ically allocated and may change on the next call to any
- HHoosstt__ procedure. Be sure to copy out any information you
- need before calling a HHoosstt__ procedure again.
-
- HHoosstt__BByyNNaammee(()) returns a Host_Entry based on the name or
- alias of a host.
-
- HHoosstt__BByyIIDD(()) returns a Host_Entry for the host with the given
- sprite ID.
-
-
-
- Sprite v.1.0 Printed: June 9, 1992 2
-
-
-
-
-
-
- Host C Library Procedures Host
-
-
-
- HHoosstt__BByyNNeettAAddddrr(()) returns the Host_Entry for the host with
- the given local-area-network address.
-
- HHoosstt__BByyIInneettAAddddrr(()) returns the Host_Entry for the host with
- the given internet address.
-
- HHoosstt__SSeettFFiillee(()) specifies a different host information file
- to use (the file normally used is //eettcc//sspprriitteehhoossttss).
-
- HHoosstt__SSttaarrtt(()) opens the current host-description file (if it
- isn't already open), while HHoosstt__EEnndd(()) closes it. The
- HHoosstt__BByy... procedures automatically call HHoosstt__SSttaarrtt.
-
- HHoosstt__NNeexxtt(()) may be used to step through the current host-
- description file. The host-description file must have been
- opened using HHoosstt__SSttaarrtt(()) or one of the HHoosstt__BByy functions.
-
- HHoosstt__SSttaatt(()) is used to get the statistics for the host-
- description file. See the ssttaatt(()) man page for details on
- the stat structure. HHoosstt__SSttaatt(()) is useful if you are writ-
- ing a daemon that wants to do something when the host-
- description file is updated. The daemon can loop waiting for
- the modify time of the file to change. Make sure the host-
- description file is closed (use HHoosstt__EEnndd(())) before the dae-
- mon waits, otherwise every machine running the daemon will
- have the host-description file open, causing lots of con-
- sistency traffic.
-
- DDIIAAGGNNOOSSTTIICCSS
- HHoosstt__SSeettFFiillee(()),HHoosstt__SSttaarrtt(()) and HHoosstt__SSttaatt(()) return zero if
- all went well. Otherwise they return -1 and the eerrrrnnoo vari-
- able contains additional information about what error
- occurred. HHoosstt__NNeexxtt(()) returns NULL on end-of-file.
- HHoosstt__BByyNNaammee(()), HHoosstt__BByyIIDD(()), HHoosstt__BByyNNeettAAddddrr(()) and
- HHoosstt__BByyIInneettAAddddrr(()) return NULL if the given host could not be
- found.
-
- FFIILLEESS
- /etc/spritehosts The default host-description file.
-
- KKEEYYWWOORRDDSS
- hostname, internet address, local net, machine type, sprite
- ID
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v.1.0 Printed: June 9, 1992 3
-
-
-
-